import { Column, Entity, PrimaryGeneratedColumn, BaseEntity, ManyToOne, ManyToMany, JoinTable, } from 'typeorm';
import { Admin } from './admin.entity';
import { Auth } from 'src/role/entities/auth.entity';
@Entity('role_admin')
export class RoleAdmin extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;
  @Column('int')
  roleId: number;
  @Column('int')
  adminId: number;
  @ManyToOne(() => Admin, admin => admin.roleAdmin)
  admin: Admin
  @ManyToMany(() => Auth, auth => auth.roleAdmin)
  @JoinTable()
  auth: Auth[]
}
